<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=yes">

    <meta content="telephone=yes,email=yes" name="format-detection">
    <!--//自动识别电话号码和邮箱-->

    <meta content="yes" name="apple-mobile-web-app-capable">
    <!--//苹果手机：会删除默认的工具栏和菜单栏，网站开启对web app程序的支持-->
    <meta name="apple-mobile-web-app-status-bar-style" content="default"/>
    <!--//苹果手机：在web app应用下状态条（屏幕顶部条）的颜色,默认值为default（白色），可以定为black（黑色）和black-translucent（灰色半透明）。-->
    <meta name="apple-touch-fullscreen" content="yes"/>
    <!--//苹果手机：如果把一个web app添加到了主屏幕中，那么从主屏幕中打开这个web app则全屏显示-->
    <link rel="apple-touch-icon" href="images/HTML5_Badge_64.png"/>
    <!--//苹果手机：将应用添加到手机主屏幕，会有一个icon可以直接进入-->
    <title>有收入</title>
    <meta name="description" content="">
    <meta name="keywords" content="">
    <!--初始化样式-->
    <link rel="stylesheet" href="css/reset.css">
    <!--共用样式-->
    <link rel="stylesheet" href="css/common.css">
    <!--整个网站的局部样式-->
    <link rel="stylesheet" href="css/style.css">
    <!--适配样式-->
    <link rel="stylesheet" href="css/styleMedia.css">
    <style>
        html, body {
            position: relative;
            overflow-x: hidden;
        }
    </style>
</head>
<body style="background-color: #f4f9fd;">

<!--header begin-->
<header>
    <div id="flexHeader">
        <div class="div1 mui-action-back"><a><img src="images/icon_arrow_left.png"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
        <div class="div2">佣金提现</div>
        <div class="div3 preservation" onclick="pageJump(this)" name="bringOutDetails">查看明细</div>
    </div>
</header>
<!--header end-->

<!--Commission begin-->
<article class="tab">
    <div class="wang-tab">
        <div class="wang-tab-head">
            <span class="wang-tab-head-title  wang-tab-head-title-2-47  wang-tab-title-transition addSelected  wang-tab-head-title-active" id='wang-tab-head-title-1'>佣金提现</span>
            <span class="wang-tab-head-title  wang-tab-head-title-2-47  wang-tab-title-transition" id='wang-tab-head-title-2'>本金提现</span>
        </div>
        <div class="content-incomplete-tasks">
            <div class="wang-tab-content wang-tab-content-1 transition">
                <div class="commission-put-forward">
                    <div>
                        <p><span id="brokerage">可提金币:&nbsp; 0金</span> &nbsp; &nbsp;   <span>冻结金币:&nbsp; 0金</span></p>
                        <p><span>实际到账:&nbsp; </span><span>0.00元(1金=0.4元)&nbsp;(免手续费)</span></p>
                    </div>
                    <div>
                        <!--<form action="" method="post">-->
                            <section>
                                <label>银行</label>
                                <input type="search" id="commissionbankName" class="ifFree"  placeholder="明生银行">
                            </section>
                            <section>
                                <label>姓名</label>
                                <input type="search" id="commissionrealName" class="ifFree"  placeholder="成某某">
                            </section>
                            <section>
                                <label>卡号</label>
                                <input type="search" id="commissionbankNum" class="ifFree"  placeholder="12345678901234567890">
                            </section>
                            <section>
                                <label>金额</label>
                                <input id="brokeragemoney" type="search" class="ifFree"  placeholder="请输入提现金额">
                            </section>
                            <section>
                                <label>登录密码</label>
                                <input id="brokeragepassword" type="password" class="ifFree"  placeholder="请输入登录密码" onmouseleave="checkInput()" oninput="changeBtnable()">
                            </section>

                            <aside>
                                <p class="presentation">提现说明</p>
                                <main>
                                    <p>1.佣金100金币起提，平台48小时内完成提现审核</p>
                                    <p>2.本金可随时提现，平台48小时内完成提现审核</p>
                                    <p>3.申请提现后，相应金币进入冻结不可用状态</p>
                                    <p>4.提现免手续费，有任何问题请联系平台客服</p>
                                    <p>5.每日提现次数最多不超过5次</p>
                                </main>
                            </aside>

                        <a href="#"><input type="submit" id="brokeragesummitBut" value="提交" class="user-login-btn-selected"></a>

                        <!--</form>-->
                    </div>
                </div>

            </div>
            <div class="wang-tab-content wang-tab-content-2 transition">
                <div class="commission-put-forward">
                    <div>
                        <p><span id="principal" >可提金币:&nbsp; 0金</span> &nbsp; &nbsp;   <span>冻结金币:&nbsp; 0金</span></p>
                        <p><span>实际到账金额:0.00元(免手续费)</span></p>
                    </div>
                    <div>
                        <!--<form action="" method="post">-->
                        <section>
                            <label>银行</label>
                            <input id="principalbankName" type="search" class="ifFree" placeholder="明生银行">
                        </section>
                        <section>
                            <label>姓名</label>
                            <input id="principalrealName" type="search" class="ifFree"  placeholder="成某某">
                        </section>
                        <section>
                            <label>卡号</label>
                            <input id="principalbankNum" type="search" class="ifFree"  placeholder="12345678901234567890">
                        </section>
                        <section>
                            <label>金额</label>
                            <input id="principalmoney" type="search" class="ifFree"  placeholder="请输入提现金额">
                        </section>
                        <section>
                            <label>登录密码</label>
                            <input id="principalpassword" type="password" class="ifFree"  placeholder="请输入登录密码" onmouseleave="checkInput()" oninput="changeBtnable()">
                        </section>

                        <aside>
                            <p class="presentation">提现说明</p>
                            <main>
                                <p>1.佣金100金币起提，平台48小时内完成提现审核</p>
                                <p>2.本金可随时提现，平台48小时内完成提现审核</p>
                                <p>3.申请提现后，相应金币进入冻结不可用状态</p>
                                <p>4.提现免手续费，有任何问题请联系平台客服</p>
                                <p>5.每日提现次数最多不超过5次</p>
                            </main>
                        </aside>

                        <a href="#"><input id="principalsummitBut" type="button" value="提交" class="summitBut user-login-btn-selected"></a>

                        <!--</form>-->
                    </div>
                </div>
            </div>
        </div>
    </div>
</article>

<!--Commission end-->


<!--js-->
<script src="js/jquery-1.12.3.min.js"></script>

<script src="js/common.js"></script>
<script src="js/mui.min.js"></script>
<script src="js/config.js"></script>
<script>
	$(function(){
		mui.plusReady(function(){
			$.ajax({
				type:"post",
				url:$CONFIG.baseUrl+"/api/refresh",
				beforeSend:function(x){
					x.setRequestHeader("Authorization",plus.storage.getItem('token'));
				},
				success :function(data){
					$("#principal").text("可提金额："+data.data.principal + "金")
					$("#brokerage").text("可提金额："+data.data.brokerage + "金")
					//佣金
					$("#commissionbankName").val(data.data.bankName);
					$("#commissionrealName").val(data.data.realName);
					$("#commissionbankNum").val(data.data.bankNum);
					//本金
					$("#principalbankName").val(data.data.bankName);
					$("#principalrealName").val(data.data.realName);
					$("#principalbankNum").val(data.data.bankNum);
				},
				error : function(){
					console.log("")
				}
			});
		})
	})
	$("#brokeragesummitBut").click(function(){
		$.ajax({
			url:$CONFIG.baseUrl+"/api/withdraw",
			type: 'post',
			data: {
				money:$("#brokeragemoney").val(),
				password:$("#brokeragepassword").val(),
				type:0
			},
			beforeSend:function(x){
				x.setRequestHeader("Authorization",plus.storage.getItem('token'));
			},
			success: function(data){
				console.log(JSON.stringify(data))
				plus.nativeUI.toast(data.msg)
				if(data.code===200){
					window.location.replace("bringOutDetails.html");
				}
			},
			errror: function(error){
				console.log('error')
			}
		})
	})
	$("#principalsummitBut").click(function(){
		$.ajax({
			url:$CONFIG.baseUrl+"/api/withdraw",
			type: 'post',
			data: {
				money:$("#principalmoney").val(),
				password:$("#principalpassword").val(),
				type:1
			},
			beforeSend:function(x){
				x.setRequestHeader("Authorization",plus.storage.getItem('token'));
			},
			success: function(data){
				console.log(JSON.stringify(data))
				plus.nativeUI.toast(data.msg)
				if(data.code===200){
					window.location.replace("bringOutDetails.html");
				}
			},
			errror: function(error){
				console.log('error')
			}
		})
	})
	
</script>

<script language="JavaScript" type="text/javascript">
    function checkInput(){
        var text = $("input").val();
        if(text==null||text==""){
            changeBtndisable();
        }
    }
    function changeBtndisable(){
        $(".summitBut").addClass("user-login-btn");
        $(".summitBut").attr("disabled","true");
    }


    function changeBtnable(){
        $(".summitBut").removeAttr("disabled").removeClass("user-login-btn");
        $(".summitBut").addClass("user-login-btn-selected");

    }
</script>
<script>
    $(".wang-tab-head-title").click(function(){
        $(".div2").html($(this).text());
    });

</script>

<script>
	
	function pageJump(dom){
		var name = $(dom).attr('name')
		mui.openWindow({
			url: name+".html",
			id: name
		})
	}
</script>
</body>
</html>